package com.zmx.doctor.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.doctor.R;
import com.zmx.doctor.pojo.Goods;
import com.zmx.doctor.pojo.GoodsOrder;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 程序猿：胖胖祥
 * 时 间：2020/12/18  11:54
 * 功 能：
 */
public class NewPrescribingAdapter extends BaseAdapterRvList<NewPrescribingAdapter.ViewHolder, GoodsOrder> {


    public NewPrescribingAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, GoodsOrder goods) {

        holder.name.setText(goods.getGoods_name());
        holder.number.setText(goods.getNumber()+"");
        holder.day.setText(goods.getDay()+"");
        holder.usage.setText(goods.getUsage()+"");

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {

        NewPrescribingAdapter.ViewHolder holder = new NewPrescribingAdapter.ViewHolder(inflater.inflate(R.layout.adapter_new_prescribing, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.name)
        TextView name;
        @BindView(R.id.day)
        TextView day;
        @BindView(R.id.number)
        TextView number;
        @BindView(R.id.usage)
        TextView usage;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }


}
